const express = require('express')
const router = express.Router()

const artCate_handler = require('../router_handler/artcate')

const expressJoi = require('@escook/express-joi') 
const {add_cate_schema,delete_cate_schema,get_cate_schema,update_cate_schema} = require('../scgena/artcate')

// 获取文章分类接口
router.get('/cates',artCate_handler.getArtCates)
// 新增文章分类接口
router.post('/addcates',artCate_handler.addArtCates)
// 根据id删除文章分类接口
router.post('/deletecate/:id',expressJoi(delete_cate_schema),artCate_handler.deleteArtCates)
// 根据id获取文章分类接口
router.get('/cates/:id',expressJoi(get_cate_schema),artCate_handler.getArtCateById)
// 根据id更新文章分类接口
router.post('/updatecate', expressJoi(update_cate_schema), artCate_handler.updateCateById)



module.exports =router